package com.maimao.api.sys;

import com.maimao.core.model.resp.PageResult;
import com.maimao.core.model.resp.Result;
import com.maimao.model.user.input.SysUserByResourceInput;
import com.maimao.model.user.sys.Role;
import com.maimao.model.user.sys.SysUser;
import com.maimao.model.user.sys.dto.DelDto;
import com.maimao.model.user.sys.dto.RoleSearchInput;
import com.maimao.model.user.sys.dto.SysUserSearchInput;
import com.maimao.model.user.sys.vo.Permissions;
import com.maimao.model.user.sys.vo.SysUserForm;
import com.maimao.model.user.sys.vo.SysUserVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * @author MaoLin Wang
 * @date 2020/11/29 2:00 下午
 */
@Api(value = "后台用户管理接口", description = "后台用户的新增、冻结、修改")
@RequestMapping("/sys/user")
public interface SysUserApi {

    @ApiOperation("根据用户名查询后台用户的权限信息")
    Result<?> getPermissionByUserName(String username);

    @ApiOperation("登录用户基本信息")
    Result<?> userInfo();


    @ApiOperation("根据名称查询后台用户")
    Result<?> findUserByName(String name);


    @ApiOperation("分页条件查询后台用户")
    Result<?> search(Integer page,
                                         Integer size,
                                         SysUserSearchInput input);


    @ApiOperation("添加员工")
    Result<?> add(SysUserForm sysUserForm, BindingResult bindingResult);

    @ApiOperation("修改员工")
    Result<?> update(SysUserForm sysUserForm, BindingResult bindingResult);

    @ApiOperation("彻底删除员工")
    Result<?> delete(Map<String, Integer> map);

    @ApiOperation("冻结/恢复员工")
    Result<?> updateStatus(DelDto delDto, BindingResult bindingResult);

    @ApiOperation("重置密码")
    Result<?> resetPass(Map<String, Integer> map);

    @ApiOperation("查询指定数量资源权限所有者的id")
    Result<?> queryByResource(SysUserByResourceInput input);

}
